package com.example.weatherpiano.DAO;

import com.example.weatherpiano.R;

import java.sql.Date;

public class CurrentWeather {
    private Integer wid;
    private String date;
    private Integer city_id;
    private String weather;
    private Integer current_temp;

    public CurrentWeather(Integer wid, String date, Integer city_id, String weather, Integer current_temp) {
        this.wid = wid;
        this.date = date;
        this.city_id = city_id;
        this.weather = weather;
        this.current_temp = current_temp;
    }

    public Integer getWid() {
        return wid;
    }

    public void setWid(Integer wid) {
        this.wid = wid;
    }

    public String getDate() {
        return date;
    }

    public void setDate(String date) {
        this.date = date;
    }

    public Integer getCity_id() {
        return city_id;
    }

    public void setCity_id(Integer city_id) {
        this.city_id = city_id;
    }

    public String getWeather() {
        return weather;
    }

    public void setWeather(String weather) {
        this.weather = weather;
    }

    public Integer getCurrent_temp() {
        return current_temp;
    }

    public void setCurrent_temp(Integer current_temp) {
        this.current_temp = current_temp;
    }

    @Override
    public String toString() {
        return "WeatherBean{" +
                "wid=" + wid +
                ", date='" + date + '\'' +
                ", city_id=" + city_id +
                ", weather='" + weather + '\'' +
                ", current_temp=" + current_temp +
                '}';
    }

    public Integer getIconId() {
        switch (weather) {
            case "晴朗" :
                return R.drawable.sun;
            case "小雨" :
                return R.drawable.rain;
            case "多云" :
                return R.drawable.cloudy;
            default:
                return 0;
        }

    }
}
